import org.hibernate.SessionFactory;
import org.hibernate.Transaction;
import org.hibernate.cfg.Configuration;
import org.hibernate.classic.Session;

import com.test.bean.Student;

public class HibernateTest {

	public static void main(String[] args) {

		SessionFactory factory = new Configuration().configure(
				"hibernate.cfg.xml").buildSessionFactory();

		Session session = factory.openSession();

		Student student = new Student();
//defect fix
		student.setStudentId(10);
		student.setFirstName("student_first");
		student.setLastName("student_last");
		student.setPassword("student_password");

		Transaction transaction = session.beginTransaction();
		transaction.begin();

		session.save(student);

		transaction.commit();

		session.close();

//Adding one more

	}

}
